<style>
.typeTable tr{padding-bottom: 5px;}
</style>
{switch name="type" }
{case value="title2"}
<table class="typeTable" cellpadding="2" cellspacing="1" width="100%">
    <tr>
        <td width="120">标题图片</td>
        <td>
            <input type="radio" name="setup[thumb]" value="1" title="是">
            <input type="radio" name="setup[thumb]" value="0" checked title="否">
        </td>
    </tr>
    <tr>
        <td>标题样式</td>
        <td>
            <input type="radio" name="setup[style]" value="1" title="是">
            <input type="radio" name="setup[style]" value="0" checked title=" 否">
        </td>
    </tr>
    <!--<tr>
        <td>文本框长度</td>
        <td><input type="text" class="layui-input input-text" size="5" name="setup[size]" value="" /></td>
    </tr>-->
</table>
{/case} 
{case value="title" }
	<div class="layui-form-item">
        <label class="layui-form-label ">默认值</label>
        <div class="layui-input-block col-sm-400">
            <input type="text" class="layui-input" size="50" name="setup[default]" value=""  >
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label ">是否密码框</label>
        <div class="layui-input-block col-sm-400">
            <input type="radio" value="1" name="setup[ispassword]" title="是">
			<input type="radio" value="0" name="setup[ispassword]" title="否" checked="" > 
        </div>
    </div>

    <input type="hidden" id="varchar" name="setup[fieldtype]" value="varchar"/> 
{/case}
{case value="textarea" }
	<div class="layui-form-item">
	    <label class="layui-form-label">字段类型：</label>
	    <div class="layui-input-block">
	    	<select name="setup[fieldtype]">
				<option value="mediumtext" >MEDIUMTEXT</option>
				<option value="text" selected>TEXT</option>
			</select>
	    </div>
  	</div>

  	<div class="layui-form-item layui-form-text">
	    <label class="layui-form-label">默认值：</label>
	    <div class="layui-input-block">
	      <textarea name="setup[default]" rows="3" cols="40" class="layui-textarea" ></textarea>
	    </div>
  	</div>

{/case}
{case value="select" }
	
	<div class="layui-form-item layui-form-text">
	    <label class="layui-form-label">选项列表</label>
	    <div class="layui-input-block">
	      <textarea name="setup[options]" placeholder="选项一|1,选项二|2" class="layui-textarea" ></textarea>
	      <div class="layui-form-mid layui-word-aux">例：选项名称|值,选项名称|值</div>
	    </div>
  	</div>

  	<div class="layui-form-item">
	    <label class="layui-form-label">选项类型</label>
	    <div class="layui-input-block">
	      	<input type="radio" value="1" title="下拉框" name="setup[multiple]" checked="" >
			<input type="radio" value="0" title="多选列表框" name="setup[multiple]" >
	    </div>
  	</div>


  	<div id="select_one" class="layui-form-item">
	    <label class="layui-form-label">字段类型</label>
	    <div class="layui-input-block">
	      	<select name="setup[fieldtype]" lay-filter="search_select_type" >
				<option value="varchar" selected>字符 VARCHAR</option>
                <option value="tinyint">整数 TINYINT(3)</option>
                <option value="smallint">整数 SMALLINT(5)</option>
                <option value="mediumint">整数 MEDIUMINT(8)</option>
                <option value="int">整数 INT(10)</option>
			</select>
	    </div>
  	</div>


  	<!-- <div id="select_more" class="layui-form-item" style="display: none;">
	    <label class="layui-form-label">字段类型</label>
	    <div class="layui-input-block">
	      	<select name="setup[fieldtype]" lay-filter="search_select_type" >
				<option value="varchar" selected>字符 VARCHAR</option>
                
			</select>
	    </div>
  	</div> -->

  	<div id="numbertype" style="display:none;" class="layui-form-item" >
		<label class="layui-form-label">是否包括负数</label>
		<div class="layui-input-block">

		  <input type="checkbox" name = "setup[numbertype]" lay-skin="primary" value="1" title="不包括负数" checked="">
		</div>
	</div>

	<!-- <div class="layui-form-item">
	    <label class="layui-form-label">可见选项的数目</label>
	    <div class="layui-input-block">
	      <input  type="text" class="layui-input" size="5" name="setup[size]" value=""  >
	    </div>
  	</div>

  	<div class="layui-form-item">
	    <label class="layui-form-label">默认值</label>
	    <div class="layui-input-block">
	      <input  type="text" class="layui-input" size="5" name="setup[default]" value=""  >
	    </div>
  	</div> -->

{/case}
{case value="editor"}
	<div class="layui-form-item">
	    <label class="layui-form-label">编辑器：</label>
	    <div class="layui-input-block">
	    	<select name="setup[edittype]" class="form-control m-b" >
				<option value="layedit" >layedit</option>
				<option value="UEditor" selected>UEditor</option>
			</select>
	    </div>
  	</div>
{/case}

{case value="date"}
	<div class="layui-form-item">
	    <label class="layui-form-label">类型：</label>
	    <div class="layui-input-block">
	    	<select name="setup[datetype]" class="form-control m-b" >
				<option value="timestamp" selected >时间戳</option>
				<option value="date" >日期保存</option>
			</select>
	    </div>
  	</div>
{/case}

{case value="datetime"}
	<div class="layui-form-item">
	    <label class="layui-form-label">类型：</label>
	    <div class="layui-input-block">
	    	<select name="setup[datetype]" class="form-control m-b" >
				<option value="timestamp" selected >时间戳</option>
				<option value="date" >日期保存</option>
			</select>
	    </div>
  	</div>
{/case}
{case value="groupid"}
<div class="form-group">
	<label class="col-sm-3 control-label">
		选项类型
	</label>
	<div class="radio i-checks">
		<label>
			<input type="radio" checked="" name="setup[inputtype]" value="checkbox"> <i></i> 复选框
			<input type="radio"  name="setup[inputtype]" value="select"> <i></i> 下拉列表框
			<input type="radio"  name="setup[inputtype]" value="radio"> <i></i> 单选框
			
		</label>
	</div>
</div>
<div class="form-group">
	<label class="col-sm-3 control-label">字段类型</label>
	<div class="col-sm-5">
		<select name="setup[fieldtype]"  onchange="javascript:numbertype(this.value);" class="form-control m-b" >
			<option value="varchar" selected>字符 VARCHAR</option>
            <option value="tinyint">整数 TINYINT(3)</option>
		</select>
		<span id="numbertype" style="display:none;"  >
			<div class="checkbox i-checks">
				<label>
					<input type="checkbox" name = "setup[numbertype]" value="1" checked=""> <i></i>不包括负数
				</label>
			</div>
		
		</span>
	</div>
</div>
<div class="form-group">
	<label class="col-sm-3 control-label">默认值</label>

	<div class="col-sm-5">
		<input  type="text" class="form-control" size="5"  name="setup[default]" value="" >
	</div>
</div>



{/case}
{case value="typeid"}
<table class="typeTable" c cellpadding="2" cellspacing="1" width="100%">
    <tr>
        <td width="120">选项类型</td>
        <td>
            <input type="radio" name="setup[inputtype]" value="checkbox" title="复选框">
            <input type="radio" name="setup[inputtype]" value="select" title="下拉列表框">
            <input type="radio" name="setup[inputtype]" value="radio" checked title="单选框">
        </td>
    </tr>
    <tr>
        <td>字段类型</td>
        <td>
            <select name="setup[fieldtype]"  onchange="javascript:numbertype(this.value);">
                <option value="varchar" selected>字符 VARCHAR</option>
                <option value="tinyint" >整数 TINYINT(3)</option>
                <option value="smallint" >整数 SMALLINT(5)</option>
            </select>
            <span id="numbertype" style="display:none;"  >
                <input type="checkbox" id="" name = "setup[numbertype]" value="1" checked title="不包括负数"/>不包括负数
            </span>
        </td>
    </tr>
    <tr>
        <td>顶级类别ID</td>
        <td> <input type="text" class="input-text layui-input" size="5"  name="setup[default]" value="" /></td>
    </tr>
</table>
{/case}
{case value="posid"}

{/case}
{case value="radio"}

	<div class="layui-form-item layui-form-text">
	    <label class="layui-form-label">选项列表</label>
	    <div class="layui-input-block">
	      <textarea name="setup[options]" placeholder="选项一|1,选项二|2" class="layui-textarea" ></textarea>
	      <div class="layui-form-mid layui-word-aux">例：选项名称|值,选项名称|值</div>
	    </div>
  	</div>

  	<div class="layui-form-item">
	    <label class="layui-form-label">字段类型</label>
	    <div class="layui-input-block">
	      	<select name="setup[fieldtype]" lay-filter="search_select_type" >
				<option value="varchar" selected>字符 VARCHAR</option>
                <option value="tinyint">整数 TINYINT(3)</option>
                <option value="smallint">整数 SMALLINT(5)</option>
                <option value="mediumint">整数 MEDIUMINT(8)</option>
                <option value="int">整数 INT(10)</option>
			</select>
	    </div>
  	</div>

  	<div id="numbertype" style="display:none;" class="layui-form-item" >
		<label class="layui-form-label">是否包括负数</label>
		<div class="layui-input-block">

		  <input type="checkbox" name = "setup[numbertype]" lay-skin="primary" value="1" title="不包括负数" checked="">
		</div>
	</div>

	<div class="layui-form-item">
	    <label class="layui-form-label">默认值</label>
	    <div class="layui-input-block">
	      <input  type="text" class="layui-input" size="5" name="setup[default]" value=""  >
	    </div>
  	</div>

{/case}
{case value="checkbox"}

	<div class="layui-form-item layui-form-text">
	    <label class="layui-form-label">选项列表</label>
	    <div class="layui-input-block">
	      <textarea name="setup[options]" placeholder="选项一|1,选项二|2" class="layui-textarea" ></textarea>
	      <div class="layui-form-mid layui-word-aux">例：选项名称|值,选项名称|值</div>
	    </div>
  	</div>

  	<div class="layui-form-item">
	    <label class="layui-form-label">字段类型</label>
	    <div class="layui-input-block">
	      	<select name="setup[fieldtype]" lay-filter="search_select_type" >
				<option value="varchar" selected>字符 VARCHAR</option>
                <!-- <option value="tinyint">整数 TINYINT(3)</option>
                <option value="smallint">整数 SMALLINT(5)</option>
                <option value="mediumint">整数 MEDIUMINT(8)</option>
                <option value="int">整数 INT(10)</option> -->
			</select>
	    </div>
  	</div>

  	<div id="numbertype" style="display:none;" class="layui-form-item" >
		<label class="layui-form-label">是否包括负数</label>
		<div class="layui-input-block">

		  <input type="checkbox" name = "setup[numbertype]" lay-skin="primary" value="1" title="不包括负数" checked="">
		</div>
	</div>

	<div class="layui-form-item">
	    <label class="layui-form-label">默认值</label>
	    <div class="layui-input-block">
	      <input  type="text" class="layui-input" size="5" name="setup[default]" value=""  >
	    </div>
  	</div>

{/case}
{case value="number"}
<div class="layui-form-item" pane="">
	<label class="layui-form-label">是否包括负数：</label>
	<div class="layui-input-block">

	  <input type="checkbox" name = "setup[numbertype]" lay-skin="primary" value="1" title="不包括负数" checked="">
	</div>
</div>

<div class="layui-form-item">
	<label class="layui-form-label">小数位数：</label>
	<div class="layui-input-block">
	  	<select name="setup[decimaldigits]">
			<option value="0"selected>0</option>
			<option value="1">1</option>
			<option value="2">2</option>
			<option value="3">3</option>
			<option value="4">4</option>
			<option value="5">5</option>
		</select>
	</div>
</div>

<div class="layui-form-item">
    <label class="layui-form-label">默认值：</label>
    <div class="layui-input-block">
      <input  type="text" class="layui-input" name="setup[default]" value="" size="40"  >
    </div>
</div>
{/case}
{case value="image"}
	<div class="layui-form-item">
	    <label class="layui-form-label">允许上传的图片类型</label>
	    <div class="layui-input-block">
	      <input  type="text" class="layui-input"  name="setup[upload_allowext]" value="{:config('webconfig')['cfg_upload_img_type']}"  >
	    </div>
  	</div>

  	<div class="layui-form-item">
	    <label class="layui-form-label">提示上传尺寸</label>
	    <div class="layui-input-block">
	      <input  type="text" class="layui-input"  name="setup[upload_size]" value=""  >
	    </div>
  	</div>

    <div class="layui-form-item">
	    <label class="layui-form-label">是否裁剪</label>
	    <div class="layui-input-block">
	      	<input type="radio" name="setup[is_crop]" value="1" title="是">
        	<input type="radio" name="setup[is_crop]" value="2" title="否" checked="" >
	    </div>
  	</div>

  	<div class="layui-form-item">
	    <label class="layui-form-label">裁剪宽</label>
	    <div class="layui-input-block">
	      	<input  type="number" class="layui-input"  name="setup[upload_size_width]" value=""  >
	    </div>
  	</div>

  	<div class="layui-form-item">
	    <label class="layui-form-label">裁剪高</label>
	    <div class="layui-input-block">
	      	<input  type="number" class="layui-input"  name="setup[upload_size_height]" value=""  >
	    </div>
  	</div>
  	
{/case}
{case value="images"}
	<div class="layui-form-item">
	    <label class="layui-form-label">允许上传的图片类型</label>
	    <div class="layui-input-block">
	      <input  type="text" class="layui-input"  name="setup[upload_allowext]" value="{:config('webconfig')['cfg_upload_img_type']}"  >
	    </div>
  	</div>

  	<div class="layui-form-item">
	    <label class="layui-form-label">提示上传尺寸</label>
	    <div class="layui-input-block">
	      <input  type="text" class="layui-input"  name="setup[upload_size]" value=""  >
	    </div>
  	</div>
  	<div class="layui-form-item">
	    <label class="layui-form-label">是否裁剪</label>
	    <div class="layui-input-block">
	      	<input type="radio" name="setup[is_crop]" value="1" title="是">
        	<input type="radio" name="setup[is_crop]" value="2" title="否" checked="" >
	    </div>
  	</div>

  	<div class="layui-form-item">
	    <label class="layui-form-label">裁剪宽</label>
	    <div class="layui-input-block">
	      	<input  type="number" class="layui-input"  name="setup[upload_size_width]" value=""  >
	    </div>
  	</div>

  	<div class="layui-form-item">
	    <label class="layui-form-label">裁剪高</label>
	    <div class="layui-input-block">
	      	<input  type="number" class="layui-input"  name="setup[upload_size_height]" value=""  >
	    </div>
  	</div>
{/case}
{case value="file"}
	<div class="layui-form-item">
	    <label class="layui-form-label">允许上传的文件类型</label>
	    <div class="layui-input-block">
	      <input  type="text" class="layui-input"  name="setup[upload_allowext]" value="{:config('webconfig')['cfg_upload_soft_type']}"  >
	    </div>
  	</div>
{/case}
{case value="video"}
	<div class="layui-form-item">
	    <label class="layui-form-label">允许上传的文件类型</label>
	    <div class="layui-input-block">
	      <input  type="text" class="layui-input"  name="setup[upload_allowext]" value="{:config('webconfig')['cfg_upload_media_type']}"  >
	    </div>
  	</div>
{/case}

{case value="template" }
	<div class="layui-form-item">
        <label class="layui-form-label ">读取文件夹名</label>
        <div class="layui-input-block col-sm-400">
            <input type="text" class="layui-input" size="50" name="setup[dirname]" value=""  >
        </div>
    </div>
{/case}

{case value="linkage"}

{/case}
{case value="files"}
<table class="typeTable" cellpadding="2" cellspacing="1" width="100%">

</table>
{/case}
{default /}
{/switch}
<script>
    layui.use(['form','iconPickerFa','upload','laydate'], function () {
        var form = layui.form,
            iconPickerFa = layui.iconPickerFa,
            layer = layui.layer,
            upload = layui.upload,
            laydate = layui.laydate,
            $ = layui.$;

        form.on('select(search_select_type)', function(data){
            var  type = data.value;
            //console.log(type)
            if(type=='varchar'){
	            $('#numbertype').hide();
	        }else{
	            $('#numbertype').show();
	        }
            return false
        });

    });
</script>